Skip to content

Fix CORS response headers#286

Merged
namedgraph merged 2 commits intodevelopfrom
fix-cors-response-headers
Apr 10, 2026
Merged

Fix CORS response headers#286
namedgraph merged 2 commits intodevelopfrom
fix-cors-response-headers

Conversation

@namedgraph
Copy link
Copy Markdown
Member

No description provided.

namedgraph and others added 2 commits April 10, 2026 13:48
Varnish caches responses without varying on Origin, so whether CORS
headers appear in cached responses depends on which request first
populated the cache. Moving CORS to nginx ensures the headers are
always present on every response regardless of cache state.

Removes JAX-RS CORSFilter and Tomcat CorsFilter (web.xml /static/*);
adds Access-Control-* headers and OPTIONS preflight (204) to nginx
location / blocks in both docker-compose.yml and nginx.conf.template.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The cors-static.sh test was failing because Access-Control-Allow-Origin
was only added to location / but not location ^~ /static/.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@namedgraph namedgraph merged commit 11da65e into develop Apr 10, 2026
1 check passed
namedgraph added a commit that referenced this pull request Apr 11, 2026
* Move CORS headers from Java filters to nginx

Varnish caches responses without varying on Origin, so whether CORS
headers appear in cached responses depends on which request first
populated the cache. Moving CORS to nginx ensures the headers are
always present on every response regardless of cache state.

Removes JAX-RS CORSFilter and Tomcat CorsFilter (web.xml /static/*);
adds Access-Control-* headers and OPTIONS preflight (204) to nginx
location / blocks in both docker-compose.yml and nginx.conf.template.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Add CORS header to /static/ nginx location blocks

The cors-static.sh test was failing because Access-Control-Allow-Origin
was only added to location / but not location ^~ /static/.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant